home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / XPK / Developer / Autodocs / xpkmaster.doc next >
Encoding:
Text File  |  1997-06-17  |  27.8 KB  |  779 lines

  1. TABLE OF CONTENTS
  2.  
  3. xpkmaster.library/XpkAllocObject
  4. xpkmaster.library/XpkClose
  5. xpkmaster.library/XpkExamine
  6. xpkmaster.library/XpkFault
  7. xpkmaster.library/XpkFreeObject
  8. xpkmaster.library/XpkOpen
  9. xpkmaster.library/XpkPack
  10. xpkmaster.library/XpkPassRequest
  11. xpkmaster.library/XpkPrintFault
  12. xpkmaster.library/XpkQuery
  13. xpkmaster.library/XpkRead
  14. xpkmaster.library/XpkUnpack
  15. xpkmaster.library/XpkWrite
  16. xpkmaster.library/--tags--
  17. xpkmaster.library/--progress--
  18. xpkmaster.library/--data hooks--
  19.  
  20. xpkmaster.library/XpkAllocObject             xpkmaster.library/XpkAllocObject
  21.  
  22.     NAME
  23.         XpkAllocObject - Allocate memory for xpk related structures (V4)
  24.  
  25.     SYNOPSIS
  26.         ptr = XpkAllocObject(type, tags)
  27.         D0                    D0    A0
  28.  
  29.         APTR  XpkAllocObject(ULONG , struct TagItem *)
  30.  
  31.         ptr = XpkAllocObjectTags(type, firsttag, ...)
  32.  
  33.         APTR  XpkAllocObjectTags(ULONG, Tag, ...)
  34.  
  35.     FUNCTION
  36.         This function allocates the memory of a needed xpk related
  37.         structure and initializes it. It should help to bring better
  38.         upwards compatibility in next versions. Use it always in newer code.
  39.  
  40.     INPUT
  41.         type    - in xpk/xpk.h defined XPKOBJ_... types.
  42.                   for example XPKOBJ_FIB alloctes XpkFib structure
  43.         tags    - Pointer to an array of struct TagItem. No tags defined
  44.                   at the moment.
  45.  
  46.     RESULT
  47.         ptr     - Pointer to allocated memory of needed size or 0 when an
  48.                   error occured.
  49.  
  50.     SEE ALSO
  51.         xpk/xpk.h, XpkFreeObject()
  52.  
  53. xpkmaster.library/XpkClose                         xpkmaster.library/XpkClose
  54.  
  55.     NAME
  56.         XpkClose - Close an XPK-File
  57.  
  58.     SYNOPSIS
  59.         err = XpkClose(xfh)
  60.         D0              A0
  61.  
  62.         LONG  XpkClose(struct XpkFib *)
  63.  
  64.     FUNCTION
  65.         Frees all resources associated with packing or unpacking an
  66.         XPK-File. Note that this may well fail, especially on packing,
  67.         since additional writes have to be made here.
  68.  
  69.     INPUT
  70.         xfh     - The Struct XpkFib obtained from XpkOpen()
  71.  
  72.     RESULT
  73.         err     - Global Xpk error code
  74.  
  75.     SEE ALSO
  76.         XpkOpen(), XpkRead(), XpkWrite()
  77.  
  78. xpkmaster.library/XpkExamine                     xpkmaster.library/XpkExamine
  79.  
  80.     NAME
  81.         XpkExamine - Get information about a compressed file
  82.  
  83.     SYNOPSIS
  84.         err = XpkExamine(fib, tags)
  85.         D0                A0   A1
  86.  
  87.         LONG  XpkExamine(struct XpkFib *, struct TagItem *)
  88.  
  89.         err = XpkExamineTags(fib, firsttag, ...)
  90.  
  91.         LONG  XpkExamineTags(ULONG, Tag, ...)
  92.  
  93.     FUNCTION
  94.         Returns information about compressed data. The output is written
  95.         to the XpkFib structure whose address is passed with the mandatory
  96.         XPK_FileExamine tag. You also have to specify an XPK_In* tag. Note
  97.         that the file position of the in hook will not be altered.
  98.     XPK_GetError is supported.
  99.         A tag field has to end with TAG_DONE.
  100.  
  101.     INPUT
  102.         tags    - Pointer to an array of struct TagItem. You may use 
  103.                   either a XPK_InBuf, a XPK_InName, XPK_InFH or XPK_InHook
  104.                   tag.
  105.  
  106.     RESULT
  107.         err     - Global Xpk error code
  108.  
  109.     SEE ALSO
  110.         xpk/xpk.h
  111.  
  112. xpkmaster.library/XpkFault                         xpkmaster.library/XpkFault
  113.  
  114.     NAME
  115.         XpkFault - Returns the text associated with a Xpk error code (V4)
  116.  
  117.     SYNOPSIS
  118.         len = XpkFault(code, header, buffer, len)
  119.         D0              D0     A0      A1     D1
  120.  
  121.         LONG XpkFault(LONG, STRPTR, STRPTR, LONG)
  122.  
  123.     FUNCTION
  124.         This routine obtains the error message text for the given error code.
  125.         The header is prepended to the text of the error message, followed
  126.         by a colon. Puts a null-terminated string for the error message into
  127.         the buffer. At most len bytes are written to buffer.
  128.  
  129.     INPUTS
  130.         code    - Error code (negative value or 0)
  131.         header  - header to output before error text
  132.         buffer  - Buffer to receive error message.
  133.         len     - Length of the buffer.
  134.  
  135.     RESULT
  136.         len     - number of characters put into buffer (may be 0)
  137.  
  138.     SEE ALSO
  139.         XpkPrintFault()
  140.  
  141. xpkmaster.library/XpkFreeObject               xpkmaster.library/XpkFreeObject
  142.  
  143.     NAME
  144.         XpkFreeObject - Frees memory allocated with XpkAllocObject() (V4)
  145.  
  146.     SYNOPSIS
  147.         XpkFreeObject(type, object)
  148.                        D0     A0
  149.  
  150.         void XpkFreeObject(ULONG , APTR)
  151.  
  152.     FUNCTION
  153.         Frees object allocated by XpkAllocObject(). Do not call for objects
  154.         allocated in any other way.
  155.  
  156.     INPUTS
  157.         type    - type passed to XpkAllocObject()
  158.         object  - pointer returned by XpkAllocObject()
  159.  
  160.     SEE ALSO
  161.         xpk/xpk.h, XpkAllocObject()
  162.  
  163. xpkmaster.library/XpkOpen                           xpkmaster.library/XpkOpen
  164.  
  165.     NAME
  166.         XpkOpen - Open a compressed file for partial reading
  167.  
  168.     SYNOPSIS
  169.         err = XpkOpen(xfh,tags)
  170.         D0            A0   A1
  171.  
  172.         LONG  XpkOpen(struct XpkFib **xfh, struct TagItem *)
  173.  
  174.     FUNCTION
  175.         Using XpkOpen you can read or write an XPK file without ever having
  176.         all of the file present in RAM. On reading, you cannot pick the 
  177.         size of the chunks. They are given by the file to be decompressed
  178.         and may be up to the whole size of the file.
  179.     XPK_GetError is supported.
  180.  
  181.     INPUT
  182.         xfh     - Address of a pointer to struct XpkFib
  183.         tags    - Specifying XPK_PackMethod will chose packing mode for
  184.                   this filehandle. Only In-tags are permitted in case
  185.                   of unpacking, and only Out-tags are in case of packing.
  186.                   Anything else will yield undefined results. Progress
  187.                   reports not supported. When packing, you must supply
  188.                   XPK_InLen as well.
  189.  
  190.     RESULT
  191.         xfh     - The filehandle. Consists of an XpkFib and some private
  192.                   information. The NLen field in the XpkFib indicates the
  193.                   length of the next chunk.
  194.         err     - Global Xpk error code. If nonzero, no XpkFib was allocated.
  195.  
  196.     SEE ALSO
  197.         XpkRead(), XpkWrite(), XpkClose(), xpkmaster.library/--tags--
  198.  
  199. xpkmaster.library/XpkPack                           xpkmaster.library/XpkPack
  200.  
  201.     NAME
  202.         XpkPack - Compress a data stream
  203.  
  204.     SYNOPSIS
  205.         err = XpkPack(tags)
  206.         D0             A0
  207.  
  208.         LONG  XpkPack(struct TagItem *)
  209.  
  210.         err = XpkPackTags(firsttag, ...)
  211.  
  212.         LONG  XpkPackTags(ULONG, Tag, ...)
  213.  
  214.     FUNCTION
  215.         Compresses a file or a memory area to a different file or memory
  216.         area. You need to specify at least one XPK_In... tag, at least
  217.         one XPK_Out... tag, plus XPK_PackMethod.
  218.     XPK_GetError is supported.
  219.         A tag field has to end with TAG_DONE.
  220.  
  221.     INPUT
  222.         tags    - Pointer to an array of struct TagItem. See xpkmaster/--tags--
  223.  
  224.     RESULT
  225.         err     - Global Xpk error code.
  226.  
  227.     SEE ALSO
  228.         xpkmaster.library/--tags--, xpk/xpk.c
  229.  
  230. xpkmaster.library/XpkPassRequest             xpkmaster.library/XpkPassRequest
  231.  
  232.     NAME
  233.         XpkPassRequest - opens a password Requester (V4)
  234.  
  235.     SYNOPSIS
  236.         err = XpkPassRequest(tags)
  237.         D0                    A0
  238.  
  239.         LONG  XpkPassRequest(struct TagItem *)
  240.  
  241.         err = XpkPassRequestTags(firsttag, ...)
  242.  
  243.         LONG  XpkPassRequestTags(ULONG, Tag, ...)
  244.  
  245.     FUNCTION
  246.         Opens a requester to ask the user for a password. The requester
  247.         can ask for a password or a 16/32 bit key. It has a tunable
  248.         timeout to allow batch work.
  249.  
  250.     INPUT
  251.         tags    - Pointer to an array of struct TagItem.
  252.                   Either XPK_Preferences or one of the following:
  253.  
  254.     TAGS
  255.         XPK_PassChars   (ULONG)
  256.            Tell the requester which characters are allowed in the password.
  257.            Use XPKPASSFLG_... and XPKPASSFF_... defines.
  258.  
  259.         XPK_PasswordBuf (STRPTR)
  260.            Pointer to memory area, where the password should be stored.
  261.            Requires XPK_PassBuffSize tag.
  262.  
  263.         XPK_PassBufSize (ULONG)
  264.            Size of the buffer passed with XPK_PasswordBuf.
  265.  
  266.         XPK_Key16BitPtr (UWORD *)
  267.            Ask for an 16 bit key instead of a password. Data is a pointer
  268.            to a 16 bit (UWORD) variable.
  269.  
  270.         XPK_Key32BitPtr (ULONG *)
  271.            Ask for an 32 bit key. Data points to a 32 bit (ULONG) variable.
  272.  
  273.         XPK_PubScreen   (struct Screen *)
  274.            Pointer of type struct Screen of the public screen, the
  275.            requester should open on. If not given, the requester opens on
  276.            default public screen.
  277.  
  278.         XPK_PassTitle   (STRPTR)
  279.            Is the text, which is shown in the title line of the screen. If
  280.            not given, the internal defaults are used.
  281.  
  282.         XPK_TimeOut     (ULONG)
  283.            Time after which the requester should close automatically, when
  284.            no user action happend. 0 means no timeout.
  285.  
  286.     RESULT
  287.         err     - Global Xpk error code.
  288.  
  289.     SEE ALSO
  290.         xpk/xpk.c
  291.  
  292. xpkmaster.library/XpkPrintFault               xpkmaster.library/XpkPrintFault
  293.  
  294.     NAME
  295.         XpkPrintFault - Prints the text associated with a Xpk error code (V4)
  296.  
  297.     SYNOPSIS
  298.         success = XpkPrintFault(code, header)
  299.         D0                   D0     A0
  300.  
  301.         BOOL XpkPrintFault(LONG, STRPTR)
  302.  
  303.     FUNCTION
  304.         This routine obtains and prints the error message text for the
  305.         given error code. This is similar to the XpkFault() function,
  306.         except that the output is written to the default output
  307.         channel with buffered output.
  308.  
  309.     INPUTS
  310.         code    - Error code (negative value or 0)
  311.         header  - header to output before error text
  312.  
  313.     RESULT
  314.         success - Success/failure code. Return of 0 means failure.
  315.  
  316.     SEE ALSO
  317.         XpkFault()
  318.  
  319. xpkmaster.library/XpkQuery                         xpkmaster.library/XpkQuery
  320.  
  321.     NAME
  322.         XpkQuery - Gain information about packers
  323.  
  324.     SYNOPSIS
  325.         err = XpkQuery(tags)
  326.         D0              A0
  327.  
  328.         LONG  XpkQuery(struct TagItem *)
  329.  
  330.         err = XpkQueryTags(firsttag, ...)
  331.  
  332.         LONG  XpkQueryTags(ULONG, Tag, ... )
  333.  
  334.     FUNCTION
  335.         Finds out a list of available packers or various parameters of a
  336.         packer. When using the tag XPK_PackersQuery, you must supply a
  337.         XpkPackerList structure and will receive a list of available
  338.         packers. The second possibility, XPK_PackerQuery, expects a
  339.         pointer to a XpkPackerInfo structure which will be filled in with
  340.         information about a packer, and XPK_ModeQuery fills in a XpkMode
  341.         structure with information about some mode (or the default mode)
  342.         of a packer. XPK_PackMethod must be present among the tags for
  343.         the latter two, and XPK_PackMode can be for ModeQuery.
  344.     XPK_GetError is supported.
  345.  
  346.     Pass {XPK_Preferences, FALSE} as tags to disable the dummy packer
  347.     USER, which implements the preferences packing.Then handle the
  348.     preferences mode internally, as the statistics passed with
  349.     XPK_ModeQuery and XPK_PackerQuery are not very useful.
  350.  
  351.     RESULT
  352.         err     - Global Xpk error code.
  353.  
  354.     SEE ALSO
  355.         xpk/xpk.h
  356.  
  357. xpkmaster.library/XpkRead                           xpkmaster.library/XpkRead
  358.  
  359.     NAME
  360.         XpkRead - Unpack one part of an XPK-File
  361.  
  362.     SYNOPSIS
  363.         read = XpkRead( xfh, buf, len )
  364.         D0              A0   A1   D0
  365.  
  366.         LONG  XpkRead(struct XpkFib *, UBYTE *, LONG)
  367.  
  368.     FUNCTION
  369.         Reads one chunk from an XPK-file and decompresses it to the
  370.         memory area indicated.
  371.  
  372.     INPUT
  373.         xfh     - The XpkFib obtained from XpkOpen(). It must be a read-
  374.                   handle, ie. there was no XPK_PackMethod tag among the
  375.                   tags passed to XpkOpen().
  376.         buf     - The memory area to write the destination to
  377.         len     - The number uncompressed bytes to output. Note that you
  378.                   cannot choose these freely but must take them from 
  379.                   the NLen field in the XpkFib.
  380.  
  381.     RESULT
  382.         read    - The number of bytes read. 0 indicates EOF, negative
  383.                   numbers are global error codes. Long error messages 
  384.                   written to buffer passed through XPK_GetError in 
  385.                   XpkOpen(). This number of bytes read will usually be
  386.                   smaller than the number requested!
  387.  
  388.     SEE ALSO
  389.         XpkOpen(), XpkWrite(), XpkClose(), examples/
  390.  
  391. xpkmaster.library/XpkUnpack                       xpkmaster.library/XpkUnpack
  392.  
  393.     NAME
  394.         XpkUnpack - Decompress a data stream
  395.  
  396.     SYNOPSIS
  397.         err = XpkUnpack(tags)
  398.         D0             A0
  399.  
  400.         LONG  XpkUnpack(struct TagItem *)
  401.  
  402.         err = XpkUnpackTags(firsttag, ...)
  403.  
  404.         LONG  XpkUnpackTags(ULONG, Tag, ...)
  405.  
  406.     FUNCTION
  407.         Decompresses a file or a memory area to a different file or memory
  408.         area. You need to specify at least one XPK_In... tag, at least
  409.         one XPK_Out... tag. A tag field has to end with TAG_DONE.
  410.     XPK_GetError is supported.
  411.  
  412.     INPUT
  413.         tags   - Pointer to an array of struct TagItem. See xpkmaster/tags
  414.  
  415.     RESULT
  416.         err    - Global Xpk error code.
  417.  
  418.     SEE ALSO
  419.         xpkmaster.library/--tags--
  420.  
  421. xpkmaster.library/XpkWrite                         xpkmaster.library/XpkWrite
  422.  
  423.     NAME
  424.         XpkWrite - Pack one part of an XPK-File
  425.  
  426.     SYNOPSIS
  427.         read = XpkWrite(xfh, buf, len)
  428.         D0              A0   A1   D0
  429.  
  430.         LONG  XpkWrite(struct XpkFib *, UBYTE *, LONG)
  431.  
  432.     FUNCTION
  433.         Compresses the memory area indicated and writes it to an
  434.         XPK-File.
  435.  
  436.     INPUT
  437.         xfh     - The XpkFib obtained from XpkOpen(). Must be a write-
  438.                   handle, ie. XPK_PackMethod must have been among the
  439.                   tags passed to XpkOpen().
  440.         buf     - The memory area to compress
  441.         len     - The number bytes to compress. Note you may not choose
  442.                   them freely, you must always deliver as many bytes
  443.                   as the NLen field of the XpkFib indicates. You may try
  444.                   to influence it by passing XPK_ChunkLen to XpkOpen().
  445.                   Important: The first chunk written *must* be the
  446.                   biggest!
  447.  
  448.     RESULT
  449.         written - The number of bytes written. 0 indicates EOF, negative
  450.                   numbers are global error codes. Error messages are 
  451.                   written to buffer passed through XPK_GetError in 
  452.                   XpkOpen().
  453.  
  454.     SEE ALSO
  455.         XpkOpen(), XpkRead(), XpkClose(), examples/
  456.  
  457. xpkmaster.library/--tags--                         xpkmaster.library/--tags--
  458.  
  459.     THE TAGS FOR XpkPack() AND XpkUnpack()
  460.  
  461.     THE INPUT TAGS. One of the four must be present.
  462.  
  463.         XPK_InName  (STRPTR)
  464.             Name of file to (de)compress. On packing, XPK_InLen can be 
  465.             specified in order to pack only the first N bytes. On de-
  466.             compression, only one file will be decompressed, even if 
  467.             there are additional data at the end.
  468.  
  469.         XPK_InFH    (BPTR)
  470.             File handle to (de)compress from. It is not necessary that
  471.             the handle is at the beginning of the file. Otherwise same
  472.             rules as in XPK_InName apply.
  473.  
  474.         XPK_InBuf   (STRPTR)
  475.             Memory block to (de)compress. If you use this one, you 
  476.             have to specify InLen as well.
  477.  
  478.         XPK_InHook  (struct Hook *)
  479.             Hookfunc to deliver data for (de)compression. See special
  480.             chapter on I/O hook functions. Must also supply XPK_InLen.
  481.  
  482.     IN ADDITION
  483.  
  484.         XPK_InLen   (LONG)
  485.             Specifies the number of bytes to read when compressing.
  486.             ignored on decompression.
  487.  
  488.     THE OUTPUT TAGS. One of the five must be present.
  489.  
  490.         XPK_OutName      (STRPTR)
  491.             Name of file write (de)compressed data to.
  492.  
  493.         XPK_OutFH        (BPTR)
  494.             File handle to append (de)compressed data to.
  495.  
  496.         XPK_OutBuf       (APTR)
  497.             The memory block to write (de)compressed data to. Must also
  498.             supply XPK_OutBufLen. On packing, its size must be at least
  499.             inlen+inlen/32+2*XPK_MARGIN. On unpacking, it needs only be
  500.             outlen+XPK_MARGIN. Use XpkExamine() to find out outlen. Note
  501.             that this buffer must be word aligned.
  502.  
  503.         XPK_GetOutBuf    (APTR *)
  504.             Allocates a block of appropriate size and stores a pointer to
  505.             it in the variable pointed to by ti_Data. Must also supply 
  506.             XPK_GetOutBufLen plus XPK_GetOutLen and can XPK_OutMemType.
  507.  
  508.         XPK_OutHook      (struct Hook *)
  509.             Hookfunc to accept (de)compressed data. See special chapter
  510.             on I/O hook functions.
  511.  
  512.     IN ADDITION
  513.  
  514.         XPK_OutBufLen    (LONG)
  515.             The length of the output buffer you supply using XPK_OutBuf.
  516.             For decompression, must be decompressed size (see XpkExamine())
  517.             plus XPK_MARGIN. For compression, inlen+inlen/32+2*XPK_MARGIN.
  518.  
  519.         XPK_GetOutLen    (LONG *)
  520.             Stores the total length of the (de)compressed data in the variable
  521.             pointed to by ti_Data. Note: V2 of xpkmaster required for correct
  522.             operation on compression.
  523.  
  524.         XPK_GetOutBufLen (LONG *)
  525.             Stores the length of the buffer allocated for the data in the
  526.             variable pointed to by ti_Data. FreeMem() the buffer you  get
  527.             from XPK_GetOutBuf with the length you get from XPK_GetOutBufLen.
  528.             Note: For the number of bytes written, refer to XPK_GetOutLen!
  529.  
  530.         XPK_OutMemType   (LONG)
  531.             The type of memory to use for the output buffer.
  532.  
  533.     PACKING TAGS
  534.  
  535.         XPK_PackMethod   (STRPTR)
  536.             Use indicated method for packing. This would be a four
  537.             letter string of uppercase characters and numbers.
  538.  
  539.         XPK_PackMode     (LONG)
  540.             Packing mode for sublib to use. Range is 0...100, where 100 is
  541.             most efficient.
  542.  
  543.         XPK_StepDown     (BOOL)
  544.             Reduce packing efficiency to save mem if necessary.
  545.  
  546.         XPK_ChunkSize    (LONG)
  547.             Chunk size to try to pack with. May be altered by the
  548.             master library.
  549.  
  550.     XPK_LossyOK     (BOOL)
  551.         Some packers, like MPEG, reduce the file size by deleting some
  552.         information. These information cannot be restored. This tag
  553.         tells xpkmaster.library if it is ok for you, that some
  554.         information is deleted. It is FALSE by default. Use it with
  555.         care! Should be used only with sound or picture files.
  556.  
  557.     QUERY TAGS
  558.  
  559.         XPK_PackersQuery (struct XpkPackerList *)
  560.             Returns an array of available packers names in the XPLIST
  561.             structure whose address is stored in the ti_Data field
  562.             of this tag.
  563.  
  564.         XPK_PackerQuery  (struct XpkPackerInfo *)
  565.             Returns information about one single packer in the XPINFO
  566.             structure whose address is stored in the ti_Data field
  567.             of this tag. See xpk/xpk.h for the meaning of the
  568.             fields therein. You must also supply XPK_PackMode.
  569.  
  570.         XPK_ModeQuery    (struct XpkMode *)
  571.             Returns information about one single packer mode in the 
  572.             XPINFO structure whose address is stored in the ti_Data 
  573.             field of this tag. See xpk/xpk.h for the meaning of 
  574.             the fields therein. You must also supply XPK_PackMethod
  575.             and optionally XPK_PackMode (or a mode in the PackMethod
  576.             string), otherwise the default mode will be used.
  577.  
  578.     OTHER TAGS
  579.  
  580.         XPK_GetError     (STRPTR)
  581.             Write error msg to the buffer passed. The buffer must be of 
  582.             size XPKERRMSGSIZE. This function calls XpkFault internally.
  583.  
  584.         XPK_Password     (STRPTR)
  585.             Use password for en- or decoding. Passing a NULL pointer or
  586.             zero length string is equivalent to omitting this tag.
  587.  
  588.         XPK_ChunkHook    (struct Hook *)
  589.             Hook function to call between chunks. Can print a progress
  590.             report, and if it returns a nonzero value, the (de)compression
  591.             will be aborted. See special chapter on chunk functions.
  592.  
  593.         XPK_PassThru     (BOOL)
  594.             If true, data will just be handed trough on decompression if they
  595.             were not packed. Otherwise you get XPKERR_NOTPACKED.
  596.  
  597.         XPK_TaskPri      (UBYTE)
  598.             The task priority to use during the (de)crunching. Use -1 for
  599.             background decompression.
  600.  
  601.         XPK_FileName     (STRPTR)
  602.             The name to print in the progress report. If none is given, the
  603.             InName will be used when packing and the OutName when unpacking.
  604.  
  605.     PREFERENCES RELATED TAGS
  606.  
  607.         XPK_UseXfdMaster (BOOL) (V4)
  608.             If TRUE, xfdmaster.library will be used for checking unknown
  609.             files. Useable with XpkUnpack() and XpkExamine(). Is FALSE by
  610.             default, but depends on preference settings.
  611.  
  612.         XPK_UseExternals (BOOL) (V4)
  613.             If TRUE, xex libraries in LIBS:compressors/extern will be used
  614.             to check for crunched files. Useable with XpkUnpack() and
  615.             XpkExamine(). Default value is TRUE (depends on prefs!)
  616.  
  617.         XPK_PassRequest (BOOL) (V4)
  618.             If this is set a requester will be used to query the user for a
  619.             password, if none is given. Useable with XpkPack(). This is
  620.             disabled by default, but can be overridden using preferences
  621.             settings.
  622.  
  623.         XPK_Preferences (BOOL) (V4)
  624.             Tell xpkmaster.library whether to use its preferences system,
  625.             or not. This is enabled by default.
  626.  
  627.     XPK_ChunkReport (BOOL) (V4)
  628.         If this tag is set, xpkmaster.library brings an automatic chunk
  629.         report request (when the preferences semaphore has a valid
  630.         function for that). This is disabled by default.
  631.  
  632. xpkmaster.library/--progress--                 xpkmaster.library/--progress--
  633.  
  634.     THE PROGRESS REPORT HOOK
  635.         The progress report function is a standard hook function that will
  636.         be called after every chunk (de)compressed. This will be about 
  637.         every 30K, or just twice if the file format is not split in chunks.
  638.         If the field h_Entry in the hook is set, it will be called with 
  639.         the hook itself in A0 and the progress report structure in A1.
  640.         If the progress report function returns a nonzero value,
  641.         (de)compression aborts.
  642.         NOTE: Because hooks are not called in program environment, they
  643.         cannot be used in small data model of some compilers, as register
  644.         A4 is not passed through. So the hook either has to be compiled in
  645.         large data model or should use __saveds keyword of some compilers.
  646.  
  647. xpkmaster.library/--data hooks--             xpkmaster.library/--data hooks--
  648.  
  649.     GENERAL
  650.     You have four methods of passing data to xpkmaster.library: file-
  651.     names, filehandles, memory areas and hooks. The hooks are described
  652.     here. The hook field h_Entry has to be standard hook functions and
  653.     gets called with the hook itself in A0 and a pointer to a XpkIOMsg
  654.     in A1. Commands are stored in xiom_Type field, data in the other
  655.     fields. Return values are 0 or any of the XPKERR codes.
  656.     Commands XIO_FREE and XIO_ABORT may be ignored.
  657.  
  658.     Whenever an error occurs, you have to return an XPKERR code and
  659.     stop work. You get a XIO_ABORT call in this case later. When no
  660.     error occured, return 0.
  661.  
  662.     You may store private data in the free fields of XpkIOMsg structure.
  663.     You are always called with XIO_FREE or XIO_ABORT, so you can free
  664.     private stuff there. Buffers can be freed, when next time a buffer
  665.     allocation is required.
  666.  
  667.         NOTE: Because hooks are not called in program environment, they
  668.         cannot be used in small data model of some compilers, as register
  669.         A4 is not passed through. So the hook either has to be compiled in
  670.         large data model or should use __saveds keyword of some compilers.
  671.  
  672.     BUFFERS
  673.     Your hooks must be able to allocate buffers for read/write or pass
  674.     pointers to them, when they are already allocated. There are some
  675.     ways you have to handle this. First there is XIO_GETBUF. When getting
  676.     this command you have to pass a memory pointer pointing to a region
  677.     of at least xmm_Size size. For in hook there is another additionally
  678.     method. When XIO_READ is wanted and xiom_Ptr is zero, then you have
  679.     to pass (and allocate) a buf pointer and to fill it!
  680.     
  681.     The buffers must be valid until you are next time asked to allocate
  682.     a buffer (either with XIO_GETBUF or XIO_READ). Then you may return
  683.     old buffer pointer (when memory is large enough) or allocate a new
  684.     buffer and free the old buffer. When XIO_ABORT or XIO_FREE is send
  685.     all your buffers should be freed.
  686.  
  687.     NOTE: Your hooks do not get called only with your own buffers, but
  688.     also with xpkmaster internally buffers!
  689.  
  690.     When your input data is already in memory, you may pass pointers
  691.     to your memory regions and need not to allocate new memory for
  692.     XIO_READ when pointer is zero. When xiom_Ptr is not zero for
  693.     XIO_READ, you have to copy the data.
  694.  
  695.     Never expect, that you are called next time with buffer you
  696.     allocated. There may be write cycles of headers and other stuff
  697.     between XIO_GETBUF and XIO_WRITE. On reading it is equal.
  698.  
  699.     COMMANDS
  700.     XIO_READ    (in hooks only)
  701.       This command is called all time xpkmaster.library needs some data.
  702.       You have to fill the supplied memory area with input data of
  703.       needed size (not more!) When the input memory pointer is zero,
  704.       you have to allocate your own buffer and fill it. When you
  705.       allocated a buffer before (either by XIO_GETBUF or XIO_READ) you
  706.       can free it when pointer is zero.
  707.       Input:    xiom_Size    size of required data
  708.               xiom_Ptr    already allocated buffer or zero
  709.       Output:    xiom_Ptr    pointer to memory area of xiom_Size
  710.  
  711.     XIO_WRITE    (out hooks only)
  712.       This function is called, when some data was compressed and should
  713.       be stored now. Copy the contents of buffer to your data storing
  714.       system.
  715.       Input:    xiom_Size    size of data
  716.               xiom_Ptr    pointer to memory area of xiom_Size
  717.       Output:    none
  718.  
  719.     XIO_FREE    (both)
  720.       You get this when work is finished, free all your stuff now.
  721.       Input:    none
  722.       Output:    none
  723.  
  724.     XIO_ABORT    (both)
  725.       You get this when work was aborted, because an error occured.
  726.       Free all your stuff now.
  727.       Input:    none
  728.       Output:    none
  729.  
  730.     XIO_GETBUF    (both)
  731.       Asks you to pass a needed buffer. This buffer is not freed by
  732.       xpkmaster.library. Do this when getting XIO_FREE, XIO_ABORT or
  733.       the next XIO_GETBUF. Input buffers may be freed too, when
  734.       XIO_READ is called with no pointer.
  735.       Input:    xiom_Size    size of necessary buffer
  736.       Output:    xiom_Ptr    pointer to the buffer
  737.  
  738.     XIO_SEEK    (both)
  739.       Change the current position in your data (like dos.library Seek
  740.       command). When you are not able to handle seek, all better
  741.       functions will fail. Pass XPKERR_NOFUNC in this case as return
  742.       value. The offset you have to seek is always relative to current
  743.       position. It can be negative too. Return value (xiom_Size) is
  744.       same as for dos.library Seek command.
  745.       Input:    xiom_Size    offset you have to seek
  746.       Output:    xiom_Size    buffer position before seek
  747.  
  748.     XIO_TOTSIZE    (both)
  749.       You either have to tell the total input data size (in hook) or get
  750.       told the total output data size (out hook).
  751.  
  752.       OUT HOOK:
  753.       XIO_TOTSIZE may be ignored here. It tells you the maximum size
  754.       of output file (the real size may be shorter). This is for
  755.       example needed in memory hooks. This is only to inform you.
  756.       This command never needs to return an error code.
  757.       Input:    xiom_Size    total size of output data
  758.       Output:    none
  759.  
  760.       IN HOOK:
  761.       XIO_TOTSIZE cannot be ignored here. When your hook cannot
  762.       determine the total filesize, return any of the XPKERR values.
  763.       XIO_TOTSIZE is called only, when xpkmaster library really needs
  764.       filesize. Normal XPK files have size information in header and
  765.       XPK_InLen flags supplies information for input. In these cases
  766.       XIO_TOTSIZE is not used. But when returning an XPKERR, your hook
  767.       will not work in other cases, when size is required.
  768.       XIO_TOSIZE is used for following cases (when no XPK_InLen is
  769.       supplied!):
  770.       - decrunching of all non-xpk files
  771.       - crunching of files
  772.       NOTE: Only the size of the part, which should be processed, is
  773.       wanted. Most time this is from current position to end of file
  774.       (memory), but it may be shorter. But generally you have to
  775.       calculate size starting at current position.
  776.       Input:    none
  777.       Output:    xiom_Size    total size of input data
  778.  
  779.